package imusic.baidu;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class SongsOfTop200SingerThread extends Thread {
    private static Log log = LogFactory.getLog(SongsOfTop200SingerThread.class);

    @Override
    public void run() {
        log.info(Thread.currentThread() + "---start");
        try {
            while (true) {
                Singer singer = Top200Singer.sinerQueue.poll();
                if (singer == null) {
                    break;
                }
                SongsOfTop200Singer.CompleteSongNum(singer);
                StringBuffer buffer = SongsOfTop200Singer.getSongsBySinger(singer);
                Util.addFile(buffer, SongsOfTop200Singer.savaPath);
                log.info(singer.getSongNum() + "---id---" + singer.getId() + "---name--" + singer.getName() + "---has over.---Thread---" + Thread.currentThread());
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
